package com.fenghuajueli.lib_net.common;

import com.blankj.utilcode.util.ToastUtils;

public abstract class DefaultObserver<T> extends ResponseObserver<T> {

    public abstract void onError(String message);

    @Override
    public void onFail(int errorCode, String message) {
        if (isShowToast()) {
            ToastUtils.showShort(message);
        }
        onError(message);
    }

    @Override
    public boolean isShowToast() {
        return true;
    }
}
